package cn.jeeweb.modules.web.labor.service.impl;

import cn.jeeweb.core.common.service.impl.CommonServiceImpl;
import cn.jeeweb.core.query.data.Page;
import cn.jeeweb.core.query.data.PageImpl;
import cn.jeeweb.core.query.data.Pageable;
import cn.jeeweb.core.query.data.Queryable;
import cn.jeeweb.core.query.parse.QueryToWrapper;
import cn.jeeweb.modules.web.labor.content.HuEmployAutoContent;
import cn.jeeweb.modules.web.labor.content.HuEmployTrainContent;
import cn.jeeweb.modules.web.labor.mapper.HuEmployAutoMapper;
import cn.jeeweb.modules.web.labor.entity.HuEmployAuto;
import cn.jeeweb.modules.web.labor.service.IHuEmployAutoService;
import com.baomidou.mybatisplus.mapper.Wrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**   
 * @Title: hu_employ_auto
 * @Description: hu_employ_auto
 * @author rql
 * @date 2018-02-27 16:09:15
 * @version V1.0   
 *
 */
@Transactional
@Service("huEmployAutoService")
public class HuEmployAutoServiceImpl  extends CommonServiceImpl<HuEmployAutoMapper,HuEmployAuto> implements  IHuEmployAutoService {


    @Resource
    private HuEmployAutoMapper huEmployAutoMapper;
    public Page<HuEmployAutoContent> selectAllList(Queryable queryable, Wrapper<HuEmployAutoContent> wrapper){
        QueryToWrapper<HuEmployAutoContent> queryToWrapper = new QueryToWrapper<HuEmployAutoContent>();
        queryToWrapper.parseCondition(wrapper, queryable);
        // 排序问题
        queryToWrapper.parseSort(wrapper, queryable);
        Pageable pageable = queryable.getPageable();
        com.baomidou.mybatisplus.plugins.Page<HuEmployAutoContent> content = new com.baomidou.mybatisplus.plugins.Page<HuEmployAutoContent>(
                pageable.getPageNumber(), pageable.getPageSize());
        List<HuEmployAutoContent> list=huEmployAutoMapper.selectAllList(content);
        content.setRecords(list);
        return new PageImpl<HuEmployAutoContent>(content.getRecords(), queryable.getPageable(), content.getTotal());
    }

}
